Random number generating circuit

ABSTRACT

According to one embodiment, a random number generating circuit includes first to N-th oscillating circuits (N is a natural number equal to 2 or greater), first to N-th latch circuits that latch outputs of the first to N-th oscillating circuits by a first clock having a first frequency, first to N-th exclusive OR circuits, (N+1)-th to (2×N)-th latch circuits that latch outputs of the first to N-th exclusive OR circuits by the first clock, an (N+1)-th exclusive OR circuit that outputs an exclusive OR of outputs of the (N+1)-th to (2×N)-th latch circuits, and an M-bit shift register that converts serial data output from the (N+1)-th exclusive OR circuit into M-bit parallel data (M is a natural number equal to 2 or greater) by a second clock having a second frequency.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is based upon and claims the benefit of priority fromJapanese Patent Application No. 2012-255734, filed Nov. 21, 2012, theentire contents of which are incorporated herein by reference.

FIELD

Embodiments described herein relate generally to a random numbergenerating circuit.

BACKGROUND

With the development of information communication technology, demand forinformation security is growing. Unpredictability in informationsecurity technology depends on the level of randomness of random dataused. That is, the security strength is increased by using data ofincreasing entropy used in information theory. For a 512-bit key, forexample, security is reinforced with the entropy increasingly closer to512.

A method of latching a fast oscillation signal by a sufficiently slowerclock has been used as a method of generating random data. If jitter ison a fast oscillation signal, random output can be obtained because thephase of the oscillation signal fluctuates with respect to the clocktiming. However, if this configuration is simply adopted, generationefficiency of random data varies depending on the clock timing andoscillation timing, and the amount of jitter, which makes the entropysmaller. In the worst case, the signal is always high or low and norandom data is generated. That is, a circuit configuration showingconsiderable variation in performance is obtained under the influence ofmanufacturing variation.

A random data generating circuit and a smoothing circuit using acontinuous oscillating circuit or intermittent oscillating circuit areknown and the problem of variation cannot be avoided even if such anintermittent oscillating circuit is used. If the signal is always highor low, the smoothing circuit becomes useless and high-entropy datacannot be obtained.

According to the technology using a plurality of oscillating circuits oractivating an oscillating circuit a plurality of times, performance ofthe oscillating circuit that outputs the maximum entropy among preparedcircuits can be adopted by using the circuits, but more entropy cannotbe obtained. According to the method of activating the same oscillatingcircuit a plurality of times, the method does not work and high-entropydata cannot be obtained if the signal is always high or low.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram showing a first embodiment;

FIG. 2 is a diagram showing the relationship between a clock number andthe probability of 0;

FIG. 3 is a diagram showing the relationship between the clock numberand entropy;

FIGS. 4 and 5 are diagrams showing modifications of FIG. 1;

FIG. 6 is a diagram showing the relationship between a thinning numberand entropy;

FIG. 7 is a diagram showing an example of an intermittent oscillatingcircuit;

FIG. 8 is a diagram showing a circuit that generates a second clock;

FIG. 9 is a circuit diagram that embodies the configuration of FIG. 8;

FIG. 10 is a diagram showing a second embodiment;

FIG. 11 is a diagram showing a third embodiment;

FIG. 12 is a diagram showing a fourth embodiment;

FIG. 13 is a diagram showing a fifth embodiment;

FIG. 14 is a diagram showing a sixth embodiment;

FIG. 15 is a diagram showing a seventh embodiment;

FIG. 16 is a timing chart showing the operation of the circuit of FIG.9;

FIG. 17 is a diagram showing a modification of the second embodiment;and

FIG. 18 is a diagram showing the relationship between the probabilityand entropy.

DETAILED DESCRIPTION

In general, according to one embodiment, a random number generatingcircuit comprising: first to N-th oscillating circuits (N is a naturalnumber equal to 2 or greater); first to N-th latch circuits that latchoutputs of the first to N-th oscillating circuits by a first clockhaving a first frequency; first to N-th exclusive OR circuits; (N+1)-thto (2×N)-th latch circuits that latch outputs of the first to N-thexclusive OR circuits by the first clock; an (N+1)-th exclusive ORcircuit that outputs an exclusive OR of outputs of the (N+1)-th to(2×N)-th latch circuits; and an M-bit shift register that convertsserial data output from the (N+1)-th exclusive OR circuit into M-bitparallel data (M is a natural number equal to 2 or greater) by a secondclock having a second frequency, wherein the output of the i-thexclusive OR circuit is the exclusive OR of i-th feedback output of asubsequent circuit of the first to N-th exclusive OR circuits and theoutput of the i-th latch circuit (i is one of 1 to N), and the secondfrequency is equal to or lower than the first frequency.

The embodiments of a random number generating circuit (entropy sourcegenerating circuit) will be described below with reference to thedrawings.

(First Embodiment)

FIG. 1 is a first embodiment of an entropy source generating circuit.

The entropy source generating circuit is a circuit that outputshigh-entropy data used for information security or the like.

First to N-th oscillating circuits (N is a natural number equal to 2 orgreater) OSC each output an oscillation signal (“0”/“1” signal). Firstto N-th latch circuits LA1 latch output from the first to N-thoscillating circuits OSC by a first clock CLK1 having a first frequency.The output from the first to N-th latch circuits LA1 is input into firstto N-th exclusive OR circuits XOR1.

(N+1)-th to (2×N)-th latch circuits LA2 latch output from the first toN-th exclusive OR circuits XOR1 by the first clock CLK1. Here, theoutput of the i-th exclusive OR circuit is an exclusive OR of the outputof the i-th latch circuit and the output of the (N+i)-th latch circuit,where i is one of 1 to N.

An N-input exclusive OR circuit XOR2 outputs an exclusive OR of theoutput of the (N+1)-th to (2×N)-th latch circuits. An M-bit shiftregister SR converts serial data output from the N-input exclusive ORcircuit XOR2 into M-bit parallel data (M is a natural number equal to 2or greater) by a second clock CLK2 having a second frequency.

The second frequency of the second clock CLK2 is equal to or less thanthe first frequency of the first clock. For example, the second clockCLK2 can be set as a clock obtained by dividing the first clock CLK1 byX (X is a natural number). Flip-flop circuits FF may be adopted for eachof the first to N-th latch circuits LA1 in the first stage and the(N+1)-th to (2×N)-th latch circuits LA2 in the second stage.

When N is large, the circuit scale of the N-input exclusive OR circuitXOR2 increases and the signal delay increases. Thus, the N-inputexclusive OR circuit XOR2 can be changed to multistage connection ofN′-input exclusive OR circuits, where N′<N.

The N flip-flop circuits FF in the first stage output uncertain data byforcibly latching oscillating signals of the N oscillating circuits OSC.However, the data may have, as described above, low output entropy dueto variations or the like.

Thus, all influences of data output from the N flip-flop circuits FF inthe first stage are retained by self-feedback of the N exclusive ORcircuits XOR1 and the N flip-flop circuits FF in the second stage.

If, for example, data output in the n-th clock from the oscillatingcircuit 1 is An, the output of the exclusive OR circuit in a subsequentstage of the oscillating circuit 1 is given by

First clock: A0⊕A1 (A0 is the initial value of output of FF in thesecond stage, ⊕ indicates an exclusive OR)

Second clock: A0⊕A1⊕A2

Third clock: A0⊕A1⊕A2⊕A3

. . .

and influences of all data beginning with the initial value areretained.

When entropy is low and the output probability of random data is low,the expected value of generating random data needs to be increased byoperating the N oscillating circuits OSC many times and random datalosses can be avoided by the N exclusive OR circuits XOR1.

If the probability of output of 0 from the N flip-flop circuits FF inthe first stage is q and the probability that the output in the n-thclock of the N exclusive OR circuits XOR1 is P_(n), the followingequation can be set up:P _(n+1) =P _(n) ×q+(1−P _(n))×(1−q)  (1)P_(n) approaches 0.5 as n increases (FIG. 2).

Entropy H_(n) of 1 bit is given byH _(n)=−(P _(n)×log₂(P _(n))+(1−P _(n))×log₂(1−P _(n)))   (2)and thus, entropy can be increased by operating the N oscillatingcircuits OSC many times (FIG. 3).

That is, even if the output of the N oscillating circuits OSC and the Nflip-flop circuits FF in the first stage is low entropy, high-entropyoutput can be obtained.

However, the self-feedback of the N exclusive OR circuits XOR1 and the Nflip-flop circuits FF in the second stage has no effect when the outputof the N oscillating circuits OSC is always high or low. Thus, alloutputs of the N oscillating circuits OSC are converted into 1-bit databy using the exclusive OR. In this manner, even if some oscillatingcircuits do not work, random data can still be generated if at least oneoscillating circuit capable of generating random data is present.

The number N of oscillating circuits may be any number equal to 2 orgreater.

However, as a property of the exclusive OR, when an exclusive OR ofoutputs of two perfectly correlated oscillating circuits is calculated,the effect of generating random data by the two oscillating circuits maybe lost. That is, when N is an even number, the effect of generatingrandom data is lost if all outputs of oscillating circuits arecorrelated.

Thus, N is desirably an odd number. If N is an odd number, even if twooscillating circuits should have correlated outputs, at least oneoscillating circuit can always avoid being correlated with otheroscillating circuits and the effect of generating random data is notlost.

Data converted into 1-bit data by the N-input exclusive OR circuit XOR2is again converted into multi-bit data by a shift register SR. However,when data is converted into multi-bit data by the shift register SR,successive two bits are correlated. When, for example, 2-bit data of then-th clock and the (n+1)-th clock is output, total entropy TH_(n) is thesum of entropy of each bit, but both bits are correlated and thus, it isnecessary to subtract randomness accumulated up to the n-th clock fromdata of the (n+1)-th clock. That is, using 1-bit entropy H_(n) of then-th clock, TH_(n) is given byTH _(n) =H _(n) +H ₁

When entropy generated by one clock after the N-input exclusive ORcircuit XOR2 is high, the shift register SR can be caused tosuccessively output at the same frequency as the first clock CLK1. Thisis a case when randomness of output of the N oscillating circuits OSCand the N flip-flop circuits FF in the first stage is high. Otherwise,the frequency of the second clock CLK2 at which the shift register SR iscaused to operate is made lower than the frequency of the first clockCLK1.

That is, data accumulating entropy for each bit may be output by makingthe period of the second clock CLK2 longer than the period of the firstclock CLK1, for example, by setting the clock obtained by dividing thefirst clock CLK1 by X (clock obtained by thinning out some clocks of thefirst clock CLK1) as the second clock CLK2.

For example, as shown in FIG. 4, the frequency of the first clock CLK1is divided by X (X is a natural number) by a frequency divider 10. Thatis, the first clock CLK 1 is input into a counter 11 and the counter 11can be caused to output the second clock CLK2 obtained by dividing thefirst clock CLK1 in accordance with the value (X) of a register 12connected to the counter 11.

In this manner, the second clock CLK2 obtained by thinning out the firstclock CLK1 by the number of cycles (X) set to the register 12 can begenerated.

How much to thin out second clock CLK2 can be predicted by monitoringoutput of the N flip-flop circuits FF in the first stage to estimate theentropy currently being generated. As a method of monitoring output ofthe N flip-flop circuits FF in the first stage, for example, as shown inFIG. 5, a monitoring shift register 13 is connected to output of the Nflip-flop circuits FF in the first stage. Then, “0 (Low)”/“1 (High)”variations of the N flip-flop circuits FF in the first stage aremeasured to be able to calculate entropy. The longer the measurement bythe shift register 13, the more correct the measurement is.

FIG. 6 is a result showing a state of the thinning number and anincrease in entropy when 8-bit output entropy is 2.9 for the thinningnumber of 0.

It is clear from FIG. 6 that the entropy increases with an increasingthinning number, that is, with a decreasing frequency of the secondclock CLK2 from the frequency of the first clock CLK1. The inclinationof an increase in entropy depends on entropy output in a cycle andentropy of the amount calculated by Formula (2) increases for a thinningnumber n. That is, by estimating entropy from output of the N flip-flopcircuits FF in the first stage, how large the thinning number should becan be predicted.

If the initial state is assumed to be “0 (Low)”, from Formula (1),P _(n)=((2q−1)^(n)+1)/2  (3)is obtained. By assuming the ratio of 0 obtained from the shift register13 artificially as the probability q, the probability P_(n) of 0 in then-th clock can be predicted from Formula (3).

Conversely, if P_(n) as the target is set, from formula (3)n=log |2P _(n)−1|/log |2q−1|  (4)is obtained to be able to estimate the necessary clock number n.

If, for example, the required entropy is h for M-bit output, the entropythat needs to be held by data for each bit can be considered to be h/M.In this case, the needed probability P_(n) is determined from Formula(2) and FIG. 18. When the needed probability P_(n) is known, the neededclock number n can be estimated from Formula (4).

That is, if “0 (Low)”/“1 (High)” variations of the N flip-flop circuitsFF in the first stage and the target entropy are known, the neededthinning number can be predicted.

The N oscillating circuits OSC may be continuous oscillating circuits orintermittent oscillating circuits, but as suggested in Patent Literature1, intermittent oscillating circuits are advantageous in terms of powerconsumption.

FIG. 7 shows an example of the intermittent oscillating circuit.

The oscillating circuit includes a 2-input NOR circuit 21 and a 2-inputexclusive OR (XOR) circuit 22. A first control signal CNT1 is input intothe 2-input NOR circuit 21. A second control signal CNT2 and the outputof the NOR circuit 21 are input into the 2-input exclusive OR circuit22. The output (oscillating signal) of the 2-input exclusive OR circuit22 is input into the 2-input NOR circuit 21 as a feedback signal.

When the first control signal CNT1 is “0 (Low)” in this oscillatingcircuit, the NOR circuit 21 is equivalent to an inverter. When the firstcontrol signal CNT1 is “1 (High)”, the output of the NOR circuit 21 is“0 (fixed)” and does not oscillate. That is, the first control signalCNT1 an be used as an oscillation trigger signal and power consumptioncan be reduced by using the first control signal CNT1 when the entropysource generating circuit in the present example is stopped.

When the second control signal CNT2 is “0”, the exclusive OR circuit 22outputs the output of the NOR circuit 21 unchanged. When the secondcontrol signal CNT2 is “1”, the exclusive OR circuit 22 is equivalent toan inverter. That is, when the first control signal CNT1 is “0”, theoscillation state and the latched state can be switched by the secondcontrol signal CNT2.

When, for example, the second control signal CNT2 should besynchronously divided by the first clock CLK1, two methods, a randomdata generation method of forcibly latching the oscillation state by theflip-flop circuit FF and a random data generation method of forciblylatching in the oscillating circuit from the oscillation state byswitching the second control signal CNT2, are executable.

Even if there is a difference of the random data generation probabilitybetween the latch by the flip-flop circuit FF and the self-latch due toelement variations or the like, the generation efficiency can beimproved by using the present circuit.

Of course, the same function can be obtained by using other logic gates.For example, NAND circuit and XNOR circuit can be used instead of NORcircuit and XOR circuit respectively.

The timing of the first control signal CNT1 and the second controlsignal CNT2 may be made common to the N oscillating circuits OSC orseparate. Particularly, the second control signal CNT2 operates the Noscillating circuits OSC independently and thus, it is more effective toshift the phase of each circuit. For example, signals of differentphases may be given to N bits of the second control signal CNT2 orphases having a 180 ° phase difference may be given to adjacentoscillating circuits.

Random data output from the N flip-flop circuits FF in the first stageis desirably independent of each other. If the random data iscorrelated, even if a pair of the N oscillating circuits OSC and the Nflip-flop circuits FF in the first stage is provided, the pair ispractically equivalent to a pair of smaller numbers of the oscillatingcircuits and the flip-flop circuits FF. Therefore, in addition to, asdescribed above, changing the phase of the second control signal CNT2,it is effective to separate the position where each oscillating circuitis mounted from each other, instead of concentrating the positions inone place inside the chip. Or, it is also effective to set the controlsignal CNT2 of one or plural oscillating circuits OSC to fixed value,and use the oscillating circuits as continuous oscillating circuits.

FIG. 8 is an example of the circuit that generates the second clockCLK2.

The circuit functions as the frequency divider 10 that divides thefrequency of the first clock CLK1 by X (X is a natural number). Thefrequency divider 10 selectively outputs the first clock CLK1 or one ofclocks obtained by dividing the first clock by X′ (X′ is a naturalnumber equal to 2 or greater) as the second clock CLK2.

For example, a counter 31 is operated by the first clock CLK1 to countthe clock number of the first clock CLK1 by the counter 31. The countnumber and clock setting data are compared by a comparator 32. When bothmatch, a thinned clock CLK3 is started up. Also, the counter 31 is resetby using the startup of the thinned clock CLK3 as a trigger.

Then, one of the first clock CLK1 and the thinned clock CLK3 is selectedby a multiplexer 33 in the end. The clock selected by the multiplexer 33is output as the second clock CLK2.

By making the first clock CLK1 selectable by using the multiplexer 33 inthis manner, the second clock CLK2 having the same frequency as thefirst clock CLK 1 can be generated. If the thinned clock CLK3 isselected, the second clock CLK2 having a lower frequency than the firstclock CLK1 can be generated.

If the above configuration is adopted, the frequency of the second clockCLK2 can arbitrarily be set after the chip production by setting theclock setting data by using software or the like.

FIG. 9 is a circuit diagram that embodies the configuration of FIG. 8.FIG. 16 shows a timing chart.

Here, a circuit capable of thinning out clocks between 0 and 15 clocksby using a 4-bit counter as the counter 31 is shown. However, instead ofa multiplexer, an AND circuit is used here as the circuit to select thefirst clock CLK1.

Outputs of the four flip-flop circuits FF counted up by the first clockCLK1 and clock setting data are compared by four exclusive OR circuitsin the comparator 32. When comparison results match in all the exclusiveOR circuits, outputs of all the exclusive OR circuits become “0” and theoutput of a 4-input NOR circuit as the output of the comparator 32becomes “1”.

In the example of the timing chart in FIG. 16, the clock setting data isassumed to be [“0”, “1”, “0”, “1”]. In this case, the clock setting dataand the output of the counter 31 match in the 11-th clock (time 1) afterstarting to count by using the 4-bit counter. Therefore, the thinnedclock CLK3 is generated.

When the timing of the thinned clock CLK3 and the timing of the firstclock CLK1 match, the second clock CLK2 is started up.

Further, when the present circuit is operating, a reset signal RS is “0”and thus, the four flip-flop circuits FF are reset when the thinnedclock CLK3 is “1”. That is, the counter 31 starts to count from 1 attime t2.

When all bits of the clock setting data (4 bits) are set to “0 (Low)” inthe present circuit, the four flip-flop circuits FF always maintain theinitial state (reset state in which all outputs are “0”) and alsooutputs all exclusive OR circuits are always “0”.

Therefore, when all bits of the clock setting data (4 bits) are set to“0”, the thinned clock CLK3 is always in the “1 (High)” state and so thesecond clock CLK 2 output from the AND circuit is the same as the firstclock CLK1.

(Second Embodiment)

FIG. 10 is a second embodiment of the entropy source generating circuit.

In the present example, self-feedback by exclusive OR circuits betweenflip-flop circuits FF in the first stage and flip-flop circuits FF inthe second stage is given between mutually different N exclusive ORcircuits. That is, random data is put together by an N-input exclusiveOR circuit XOR2 in the next stage and thus, the self-feedback does nothave to be given by the same exclusive OR circuits.

Here, self-feedback of exclusive OR circuits in the subsequent stage ofan oscillating circuit 1 is given by the output (output by FF) ofexclusive OR circuits in the subsequent stage of an oscillating circuit2 and similarly, self-feedback of exclusive OR circuits in thesubsequent stage of oscillating circuits 2 to (N−1) is given by theoutput (output by FF) of exclusive OR circuits in the subsequent stageof oscillating circuits 3 to N.

Self-feedback of exclusive OR circuits in the subsequent stage of theoscillating circuit N is given by the output (output by FF) of exclusiveOR circuits in the subsequent stage of the oscillating circuit 1.

According to the present example, an output signal of each oscillatingsignal can be linked by the self-feedback and thus, as shown in FIG. 17,the N-input exclusive OR circuit XOR2 in FIG. 10 can be omitted. In thiscase, when compared with the example in FIG. 10, the example in FIG. 17achieves an effect of being able to make the circuit scale smaller.

In the present example, the feedback destination can appropriately bechanged for the purpose of making the wiring length of the self-feedbackas short as possible during circuit design or mounting.

(Third Embodiment)

FIG. 11 is a third embodiment of the entropy source generating circuit.

In the present example, a voltage control circuit 14 is newly providedas a power supply of N oscillating circuits OSC. Whether data latched byflip-flop circuits FF in the first stage is random depends on each ofthe oscillation timing of N oscillating circuits OSC and the timing ofthe first clock CLK1. If, for example, the first clock CLK1 becomes “1”in the timing of the transition of output of the N oscillating circuitsOSC, N flip-flop circuits in the subsequent stage FF becomes meta-stableand the output thereof is undefined.

However, if the first clock CLK1 becomes “1” when the output of the Noscillating circuits OSC is “1 (High)” or “0 (Low)”, the N flip-flopcircuits FF in the subsequent stage output “1” or “0” and thus, randomdata cannot be obtained.

Therefore, when it is determined that the output of the N flip-flopcircuits FF in the subsequent stage is not random data, the supplyvoltage of the N oscillating circuits OSC is changed by the voltagecontrol circuit 14.

That is, the oscillating frequency of the N oscillating circuits OSCdepends on the supply voltage and thus, settings can be made so that thefirst clock CLK1 becomes “1” in the timing of the transition of outputof the N oscillating circuits OSC by changing the oscillating frequencyof the N oscillating circuits OSC. Accordingly, random data can begenerated.

An example of controlling the oscillating frequency by the supplyvoltage of the N oscillating circuits OSC is shown in the presentexample, but instead thereof or together therewith, the oscillatingfrequency may be controlled by other elements such as the ground voltageand the substrate voltage.

There is no need for all the N oscillating circuits OSC to be commonlyconnected to the voltage control circuit 14. That is, the control of theoscillating frequency (for example, the control of the supply voltage)of the N oscillating circuits OSC may be exercised independently or theN oscillating circuits OSC may be divided into a plurality of groups,each of which to be controlled independently.

The effect of generating entropy is increased by, rather than providinga voltage control circuit common to all the N oscillating circuits OSC,providing, for example, a voltage control circuit to each of the Noscillating circuits OSC independently so that the oscillating frequencyof the N oscillating circuits OSC can be controlled independently andappropriately, though the circuit scale grows.

(Fourth Embodiment)

FIG. 12 is a fourth embodiment of the entropy source generating circuit.

In the present example, an enable terminal to control the start/end ofan oscillation operation is provided in each of N oscillating circuitsOSC. When, for example, the intermittent oscillating circuit in FIG. 7is used as the oscillating circuit, a first control signal CNT1 or asecond control signal CNT2 can be used as an enable signal to controlthe start/end of the oscillation operation.

Then, an enable control circuit 15 is connected to the N oscillatingcircuits OSC. The enable control circuit 15 outputs an enable signal toeach of the N oscillating circuits OSC.

As described above, whether data latched by N flip-flop circuits FF inthe subsequent stage becomes random changes depending on the oscillationperiod of the N oscillating circuits OSC and the timing of a first clockCLK 1. That is, the same value will always be output if the oscillationperiod or the clock timing is not optimum.

When viewed from the effect of generating random data, whether anoscillating circuit continuing to always output the same value isoperating or stopped does not influence the effect at all. Therefore,the oscillating circuit in such a state is stopped by an enable signal.

Accordingly, power consumption of the entropy source generating circuitcan be reduced. In addition, entropy can be generated by just enoughpower consumption by setting the enable signal appropriately.

(Fifth Embodiment)

FIG. 13 is a fifth embodiment of the entropy source generating circuit.

In the present example, a first clock CLK1 is used for a shift registerSR. That is, N flip-flop circuits FF in the first stage, N flip-flopcircuits FF in the second stage, and the shift register SR are allcontrolled by the same clock (first clock CLK1). In this case, anoperation of thinning out data by the second clock like in each of theabove embodiments cannot be performed.

Then, instead, M′ (M′ is a natural number equal to M or smaller)multiplexers 16′ capable of selecting one of M bits (M is a naturalnumber equal to 2 or greater) from the M-bit shift register SR by anoutput selection signal SEL is provided. The M′ multiplexers 16 outputM′ bits.

Accordingly, M′ bits output from the M′ multiplexers 16 can beconsidered as random data and used as an entropy source. That is, in thepresent example, instead of thinning out data by changing the clock, amethod of thinning out data when data stored in the shift register SR isoutput is adopted.

According to the present example, while the number of bits of the shiftregister SR increases and additional elements such as multiplexers areneeded, an entropy source generating circuit can advantageously becontrolled by a clock.

(Sixth Embodiment)

FIG. 14 is a sixth embodiment of the entropy source generating circuit.

In the present example, based on outputs of N flip-flop circuits FF inthe first stage, entropy generated by the outputs is measured by usingan entropy measuring circuit 17. Then, based on the entropy, a clockcontrol circuit 18 generates a second clock CLK2 and provides the secondclock CLK2 to a shift register SR.

For the measurement of entropy, for example, outputs of the N flip-flopcircuits FF in the first stage are stored in a shift register in theentropy measuring circuit 17, the ratio of “0” or “1” is measured, andthe ratio is artificially considered as a probability P to calculateentropy according to Formula (2) and FIG. 18.

However, if the shift register value in the entropy measuring circuit 17repeatedly takes “0” and “1” periodically, P=0.5 is obtained and norandomness is recognized.

When, for example, each of N oscillating circuits OSC is a continuousoscillating circuit, cases in which outputs of the N flip-flop circuitsFF in the first stage are assumed to have no randomness at all are thosecases in which outputs of the same value continue, “0”/“1” isalternately repeated for each clock or the like. In such cases, bystoring outputs of the N flip-flop circuits FF in the first stage inevery, for example, two clocks in the shift register, a state (P=0.5) inwhich the shift register value periodically repeats between “0” and “1”can be avoided.

When P=0.5 and randomness should no longer be recognized, entropy ismeasured by setting P=0.

Similarly, when the intermittent oscillating circuit shown in FIG. 7 isused for each of the N oscillating circuits OSC, the N oscillatingcircuits OSC repeat alternately between the oscillation state and theholding state if the second control signal CNT2 is assumed to be asignal of the same frequency as a first clock CLK1.

Like the continuous oscillating circuit, a state in which “0” and “1”are periodically repeated is possible in the oscillation state and theholding state and thus, when the intermittent oscillating circuit isused, outputs of the N flip-flop circuits FF in the first stage arestored in the shift register in every, for example, four clocks.Accordingly, a state (P=0.5) in which the shift register valueperiodically repeats between “0” and “1” can be avoided.

High-entropy data can be obtained by measuring entropy by using Formula(2) and FIG. 18 to automatically set the thinning amount of data, thatis, a difference between the frequency of the first clock CLK1 and thefrequency of the second clock CLK2 according to Formula (4).

(Seventh Embodiment)

FIG. 15 is a seventh embodiment of the entropy source generatingcircuit.

The present example shows a configuration example in which the order ofan exclusive OR circuit that gives self-feedback and an N-inputexclusive OR circuit that calculates an exclusive OR of all outputs of Noscillating circuits OSC is interchanged.

For example, an N-input exclusive OR circuit XOR2 calculates anexclusive OR of N flip-flop circuits FF in the first stage. The outputof the N-input exclusive OR circuit XOR2 is input into a 2-inputexclusive OR circuit XOR3 that gives self-feedback. Further, the outputof the 2-input exclusive OR circuit XOR3 is input into a flip-flopcircuit FF (latch circuit LA3) in the second stage and the output of theflip-flop circuit FF in the second stage is input into the 2-inputexclusive OR circuit XOR3 as feedback.

Because the exclusive OR does not depend on the order of operations asshown above and thus, an effect like the effect in the first embodimentcan also be obtained according to the present configuration. By adoptingthe configuration in the present example, while the operation load isdifferent between the flip-flop circuits FF in each stage (unbalanced),the circuit scale as an entropy source generating circuit canadvantageously be made smaller.

In the seventh embodiment, the frequency divider 10 shown in FIGS. 4, 8,and 9, the shift register 13 shown in FIG. 5, and the oscillatingcircuit OSC shown in FIG. 7 can be adopted.

Also in the seventh embodiment, the third to sixth embodiments (FIGS. 11to 14) can be adopted.

CONCLUSION

According to the first to seventh embodiments described above, anentropy source generating circuit resistant to manufacturing variationand capable of generating high-entropy random data can be realized evenif oscillating circuit performance falls to low entropy.

In addition, the optimum or maximum effect can be achieved by mutuallycombining the first to seventh embodiments.

While certain embodiments have been described, these embodiments havebeen presented by way of example only, and are not intended to limit thescope of the inventions. Indeed, the novel embodiments described hereinmay be embodied in a variety of other forms; furthermore, variousomissions, substitutions and changes in the form of the embodimentsdescribed herein may be made without departing from the spirit of theinventions. The accompanying claims and their equivalents are intendedto cover such forms or modifications as would fall within the scope andspirit of the inventions.

What is claimed is:
 1. A random number generating circuit comprising:first to N-th oscillating circuits (N is a natural number equal to 2 orgreater); first to N-th latch circuits that latch outputs of the firstto N-th oscillating circuits by a first clock having a first frequency;first to N-th exclusive OR circuits; (N+1)-th to (2×N)-th latch circuitsthat latch outputs of the first to N-th exclusive OR circuits by thefirst clock; an (N+1)-th exclusive OR circuit that outputs an exclusiveOR of outputs of the (N+1)-th to (2×N)-th latch circuits; and an M-bitshift register that converts serial data output from the (N+1)-thexclusive OR circuit into M-bit parallel data (M is a natural numberequal to 2 or greater) by a second clock having a second frequency,wherein the output of the i-th exclusive OR circuit is the exclusive ORof i-th feedback output of a subsequent circuit of the first to N-thexclusive OR circuits and the output of the i-th latch circuit (i is oneof 1 to N), the second frequency is equal to or lower than the firstfrequency, each of the first to N-th oscillating circuits includes a NORcircuit into which a first control signal is input and an exclusive ORcircuit into which a second control signal and the output of the NORcircuit are input and which outputs an oscillating signal, and theoscillating signal is input into the NOR circuit as a feedback signal.2. The circuit of claim 1, wherein the i-th feedback output is theoutput of the (N+i)-th latch circuit (i is a number from 1 to N).
 3. Thecircuit of claim 1, wherein the i-th feedback output is the output ofthe (N+i+1)-th latch circuit (i is a number from 1 to N−1) and the N-thfeedback output is the output of the (N+1)-th latch circuit.
 4. Thecircuit of claim 1, further comprising: a frequency divider that dividesthe first frequency by X (X is a natural number), wherein the secondclock is output from the frequency divider.
 5. The circuit of claim 4,wherein the frequency divider selectively outputs one of the first clockand a clock obtained by dividing the first clock by X′ (X′ is a naturalnumber equal to 2 or greater) as the second clock.
 6. The circuit ofclaim 4, further comprising: first to N-th shift registers that monitoroutputs of the first to N-th latch circuits, wherein the X is determinedbased on outputs of the first to N-th shift registers.
 7. The circuit ofclaim 1, further comprising: M multiplexers capable of selecting one ofM bits from the M-bit shift register by an output selection signal,wherein the first and second frequencies are equal and the M bits fromthe M multiplexers are used as an entropy source.
 8. The circuit ofclaim 1, further comprising: an entropy measuring circuit that measuresentropy based on outputs of the first to N-th latch circuits; and aclock control circuit that generates the second clock based on theentropy measured by the entropy measuring circuit.
 9. The circuit ofclaim 1, wherein a value of the N is an odd number.
 10. A random numbergenerating circuit comprising: first to N-th oscillating circuits (N isa natural number equal to 2 or greater); first to N-th latch circuitsthat latch outputs of the first to N-th oscillating circuits by a firstclock having a first frequency; a first exclusive OR circuit thatoutputs an exclusive OR of outputs of the first to N-th latch circuits;a second exclusive OR circuit; an (N+1)-th latch circuit that latchesthe output of the second exclusive OR circuit by the first clock; and anM-bit shift register that converts serial data output from the (N+1)-thlatch circuit into M-bit parallel data (M is a natural number equal to 2or greater) by a second clock having a second frequency, wherein theoutput of the second exclusive OR circuit is the exclusive OR of theoutput of the first exclusive OR circuit and the output of the (N+1)-thlatch circuit, the second frequency is equal to or lower than the firstfrequency, each of the first to N-th oscillating circuits includes a NORcircuit into which a first control signal is input and an exclusive ORcircuit into which a second control signal and the output of the NORcircuit are input and which outputs an oscillating signal, and theoscillating signal is input into the NOR circuit as a feedback signal.11. The circuit of claim 10, further comprising: a frequency dividerthat divides the first frequency by X (X is a natural number), whereinthe second clock is output from the frequency divider.
 12. The circuitof claim 11, wherein the frequency divider selectively outputs one ofthe first clock and a clock obtained by dividing the first clock by X′(X′ is a natural number equal to 2 or greater) as the second clock. 13.The circuit of claim 11, further comprising: first to N-th shiftregisters that monitor outputs of the first to N-th latch circuits,wherein the X is determined based on outputs of the first to N-th shiftregisters.
 14. The circuit of claim 10, further comprising: Mmultiplexers capable of selecting one of M bits from the M-bit shiftregister by an output selection signal, wherein the first and secondfrequencies are equal and the M bits from the M multiplexers are used asan entropy source.
 15. The circuit of claim 10, further comprising: anentropy measuring circuit that measures entropy based on outputs of thefirst to N-th latch circuits; and a clock control circuit that generatesthe second clock based on the entropy measured by the entropy measuringcircuit.
 16. The circuit of claim 10, wherein a value of the N is an oddnumber.
 17. A random number generating circuit comprising: first to N-thoscillating circuits (N is a natural number equal to 2 or greater);first to N-th latch circuits that latch outputs of the first to N-thoscillating circuits by a first clock having a first frequency; first toN-th exclusive OR circuits; (N+1)-th to (2×N)-th latch circuits thatlatch outputs of the first to N-th exclusive OR circuits by the firstclock; an (N+1)-th exclusive OR circuit that outputs an exclusive OR ofoutputs of the (N+1)-th to (2×N)-th latch circuits; an M-bit shiftregister that converts serial data output from the (N+1)-th exclusive ORcircuit into M-bit parallel data (M is a natural number equal to 2 orgreater) by a second clock having a second frequency; and a frequencydivider that divides the first frequency by X (X is a natural number),wherein the output of the i-th exclusive OR circuit is the exclusive ORof i-th feedback output of a subsequent circuit of the first to N-thexclusive OR circuits and the output of the i-th latch circuit (i is anumber from 1 to N), the second frequency is equal to or lower than thefirst frequency, the i-th feedback output is the output of the (N+i)-thlatch circuit (i is a number from 1 to N), each of the first to N-thoscillating circuits includes a NOR circuit into which a first controlsignal is input and an exclusive OR circuit into which a second controlsignal and the output of the NOR circuit are input and which outputs anoscillating signal, and the oscillating signal is input into the NORcircuit as a feedback signal.